{% for i in list_mat|dictsort:'name'|dictsort:'qle' %}
<li>
	{% if first == 1 %}<b>{% endif %} ({{i.qle }}) {{ i.name }} : {{ i.qte|floatformat:"0" }}{% if first == 1 %}</b>{% endif %}{% if i.materials != None %} <button class="button, button{{ i.typeid }}" id="button{{ i.typeid }}" onclick="update({{ i.typeid }}, '/shoplist/update_')">Show {{ i.typeid }}</button>
</li>
			
{% if i.minimum == 0 %}
<ul id="{{ i.typeid }}" class="{{ i.typeid }}{% if first == 1 %} first{% endif %} {{ i.qle|floatformat:"0" }}">
	{% else %}
	<ul id="{{ i.typeid }}" class="{{ i.typeid }}{% if first == 1 %} first{% endif %}" style="display:none;">
	{% endif %}
		{% with first=0 list_mat=i.materials template_name="list_loop.html" %}
			{% include template_name %}
	{% endwith %}
</ul>
			
{% else %}
</li>
{% endif %}

{% endfor %}